import config from '@/utils/config'
import { generateRequest } from '@/utils/request'
const { apiUrlPrefix } = config

/** 陪护订单列表 */
export const companionOrderListApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/list`)

/** 陪护订单详情 */
export const getCompanionOrderApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/{id}`, 'get')

/** 医院和院区列表 */
export const hospitalAndAreaOptionsApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/hospitalAndAreaOptions`)

/** 护工派单分页列表 */
export const getDeliveryOrderNursingWorkerPageListApi = generateRequest(
  `${apiUrlPrefix}/pcs/nursingWorkers/getDeliveryOrderNursingWorkerPageList`,
)

/** 查询订单关联的交易单列表 */
export const getTradeOrderListByOrderIdApi = generateRequest(
  `${apiUrlPrefix}/pcs/companionOrder/trade/getTradeOrderListByOrderId`,
)

/** 提交陪护方案 */
export const submitCompanionPlanApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/submitCompanionPlan`)

/** 取消订单 */
export const cancelCompanionOrderApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/cancelOrder`)

/** 获取订单应付金额 */
export const getPayableAmountByOrderIdApi = generateRequest(
  `${apiUrlPrefix}/pcs/companionOrder/getPayableAmountByOrderId`,
)

/** 生成交易单 */
export const createPcTradeOrderApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/trade/createPcTradeOrder`)

/** 支付 */
export const payCompanionOrderApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/trade/pay`)

/** 查询交易单信息 */
export const getTradeOrderByTradeIdApi = generateRequest(
  `${apiUrlPrefix}/pcs/companionOrder/trade/getTradeOrderByTradeId`,
)

/** 更换陪护套餐下的护工 */
export const changeNursingWorkerApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/changeNursingWorker`)

/** 终止服务 */
export const stopServiceApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/stopService`)

/** 续费计算服务天数 */
export const calculateServiceDaysApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/calculateServiceDays`)

/** 生成续费交易单 */
export const createPcRenewTradeOrderApi = generateRequest(
  `${apiUrlPrefix}/pcs/companionOrder/trade/createPcRenewTradeOrder`,
)

/** 服务订单续期(续费) */
export const orderRenewApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/orderRenew`)

/** 获取appId */
export const getAppIdApi = generateRequest(`${apiUrlPrefix}/pcs/companionOrder/getAppId`)
